﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using iLangl.BusinessModel.Actions.Push;
using iLangl.Customer.Actions;
using iLangl.Tests.CustomerActions;
using System.Security;

namespace iLangl.Tests.AlertsFixture
{
	[TestClass]
	public class ActionExceptionAlertFixture : ProjectValidationTest
	{
		[TestMethod]
		[ExpectedException(typeof(AlertException))]
		public void ActionExceptionAlert()
		{
			IAlert alert =  Facade.Instance.AlertManager.CreateAlert(this);

			RegisterNewProjectAction registerNewProject = new RegisterNewProjectAction(GetProject());

			SecurityException se = new SecurityException("Authorization Failed");

			alert.AddException(se);
			alert.AddAction(registerNewProject);


			IError error = new Error("This is a test message", "This is a test description", eSeverity.High);
			alert.AddError(error);

			
			Facade.Instance.AlertManager.RaiseAlert(alert);


		}
	}
}
